import { getFactoryKey } from "../getFactoryKey";

// 存储工厂简易信息
export class FactoryInfo {
	id : string;
	name : string;
	iconType : string;
	iconUrl : string
	constructor(name : string, iconType : string, iconUrl : string) {
		do {
			this.id = Math.floor(Math.random() * 1000).toString();
			// console.log("随机id：" + this.id);
		}
		while (localStorage.getItem(getFactoryKey(this.id)) != undefined);
		this.name = name;
		this.iconType = iconType;
		this.iconUrl = iconUrl;
	}
}
